package rules.tree;

import org.jdom.Element;

public class ClassAtom extends Atom{

	private String attribute,constant;
	private Var v1;
	private Function f1;

	public ClassAtom(String attribute, Var v1) {
            super(new Element("classAtom"));
            el.setAttribute("class", attribute);
            Element c = new Element("args");
            el.addContent(c);
            c.addContent(v1.getElement());
            this.attribute = attribute;
            this.v1 = v1;
	}
	
	public ClassAtom(String attribute, String constant) {
            super(new Element("classAtom"));
            el.setAttribute("class", attribute);
            Element c = new Element("args");
            el.addContent(c);
            Element e2 = new Element("constant");
            e2.setText(constant);
            c.addContent(e2);
            this.attribute = attribute;
            this.constant = constant;
	}

        /*falta incluir elemento que representa a função*/
	public ClassAtom(String attribute, Function f1) {
            super(new Element("classAtom"));
            el.setAttribute("class", attribute);
            Element c = new Element("args");
            el.addContent(c);
            c.addContent(f1.getElement());
            this.attribute = attribute;
            this.f1 = f1;
	}

        ClassAtom(Element el) {
            super(el);
        }

	public String getAttribute(){
            return attribute;
	}
	
	public Var getVar(){
            return v1;
	}
	
	public String getConstant(){
            return constant;
	}
	
	public Function getFunction(){
            return f1;
	}

   

}
